var app = getApp(),
$ = require("../../utils/httpHelper.js")

Page({
  data: {
    urlsimg:[],
    isimg:false,
    width:0,
    height:0,
    imgheight:0,
    imgwidth:0
  },
  
  onLoad: function (options) {
    let that = this
    wx.getSystemInfo({
      success: function (res) {
        that.setData({ height: res.windowHeight,
          width: res.windowWidth  })
      }
    })
    console.log(app.globalData.imgpop)
    if (app.globalData.imgpop.length !=0){
      this.setData({
        urlsimg: app.globalData.imgpop
      })
    }
    
    
  },
  onShow(){
    
  },
  imageLoad: function (e) {
    console.log('jfjfjkdsjflkds')
    var _this = this;
    var $width = e.detail.width,    //获取图片真实宽度  
      $height = e.detail.height,
      ratio = $width / $height;   //图片的真实宽高比例  
    var viewWidth = this.data.width + 20,           //设置图片显示宽度，  
      viewHeight = this.data.width / ratio;    //计算的高度值     
    this.setData({
      imgwidth: viewWidth,
      imgheight: viewHeight
    })
    console.log(this.data.imgheight)
  },
  
})
